home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 37 / CD Expert nº 37.iso / LastCall / lastcall.exe / stuff / lastcall.dxr / 00033_Arbus during Bounce Behavior.ls < prev    next >
Encoding:
Text File  |  2000-03-27  |  3.6 KB  |  184 lines

  1. property pCharCode, pDownFlag, pOrigRect, pOrigReg, pBigFlashRect, pSoundChannel, pSpr, ancestor, pFrameToRecreate
  2. global gBarTopManager, debug, gCharChildren, gGameLevel, gMachineSpeed, gBounceInProgress
  3.  
  4. on removeCharacterTraces me
  5.   pCharCode = VOID
  6.   ancestor = VOID
  7. end
  8.  
  9. on beginSprite me
  10.   global gArbusSoundChan
  11.   pSoundChannel = gArbusSoundChan
  12.   pSpr = sprite(me.spriteNum)
  13.   pSpr.quality = #high
  14.   setFlashRectsInk(me)
  15.   removeCharacterTraces(me)
  16.   hide(me)
  17.   setFlashAttributes(me)
  18.   fixEventTriggers(me)
  19.   hide(me)
  20.   if pSpr.frame = 1 then
  21.     pSpr.frame = 2
  22.   end if
  23. end
  24.  
  25. on setFlashRectsInk me
  26.   global gShowFlashRects
  27.   if gShowFlashRects = 1 then
  28.     pSpr.ink = 0
  29.   else
  30.     pSpr.ink = 36
  31.   end if
  32. end
  33.  
  34. on mouseDown
  35.   pDownFlag = 1
  36.   nothing()
  37. end
  38.  
  39. on mouseEnter
  40.   pDownFlag = 0
  41.   if not draggingAnything() then
  42.     showToolTip(pSpr, #ab)
  43.   end if
  44. end
  45.  
  46. on mouseLeave
  47.   pDownFlag = 0
  48.   if not draggingAnything() then
  49.     hideToolTip()
  50.   end if
  51. end
  52.  
  53. on mouseUp me
  54.   if pDownFlag then
  55.     checkIfFlashWasHit(me, pSpr)
  56.   end if
  57. end
  58.  
  59. on goBase me
  60.   playAnim(me, #base1, VOID, #stationary)
  61. end
  62.  
  63. on mRecreate me, character, status, frameNum, throttleTime, animating, turnOffAnim, inRect
  64.   global gImplementedCharacters
  65.   pCharCode = character
  66.   if voidp(pCharCode) then
  67.     removeCharacterTraces(me)
  68.     exit
  69.   end if
  70.   ancestor = gCharChildren[pCharCode]
  71.   pSpr.member = me.pFlashCharMember
  72.   updateStage()
  73.   pSpr.member = pSpr.member
  74.   setFlashAttributes(me)
  75.   reg = gImplementedCharacters[pCharCode][#regPoint]
  76.   pSpr.member.regPoint = reg
  77.   pBigFlashRect = offset(pOrigRect, pOrigReg.locH - reg.locH, pOrigReg.locV - reg.locV)
  78.   pFrameToRecreate = frameNum
  79. end
  80.  
  81. on mReposition me
  82.   if voidp(pFrameToRecreate) then
  83.     hide(me)
  84.     exit
  85.   end if
  86.   fixEventTriggers(me)
  87.   gotoFlashFrame(pSpr, pFrameToRecreate, 1)
  88. end
  89.  
  90. on replicate me, patronSprite
  91.   global gImplementedCharacters
  92.   pCharCode = patronSprite.pCharCode
  93.   ancestor = patronSprite.scriptInstanceList[1]
  94.   pOrigRect = patronSprite.rect
  95.   pOrigReg = patronSprite.member.regPoint
  96.   pSpr.member = patronSprite.pFlashCharMember
  97.   updateStage()
  98.   setFlashAttributes(me)
  99.   reg = gImplementedCharacters[pCharCode][#regPoint]
  100.   pBigFlashRect = offset(pOrigRect, pOrigReg.locH - reg.locH, pOrigReg.locV - reg.locV)
  101.   show(me)
  102.   fixEventTriggers(me)
  103.   gotoFrame(pSpr, patronSprite.frame)
  104. end
  105.  
  106. on setFlashAttributes me
  107.   pSpr.actionsEnabled = 0
  108.   pSpr.buttonsEnabled = 0
  109.   pSpr.static = 1
  110.   pSpr.originMode = #topLeft
  111.   pSpr.clickMode = #boundingBox
  112. end
  113.  
  114. on fixEventTriggers me
  115.   global gLeadFrames
  116.   show(me)
  117.   pSpr.rect = rect(0, 0, 1, 1)
  118.   updateStage()
  119.   gotoFrame(pSpr, 1)
  120.   updateStage()
  121.   gotoFrame(pSpr, 2)
  122.   updateStage()
  123. end
  124.  
  125. on speak me
  126.   dontPassEvent()
  127. end
  128.  
  129. on newRect me
  130.   dontPassEvent()
  131. end
  132.  
  133. on move_glass me
  134.   dontPassEvent()
  135. end
  136.  
  137. on adjustFlashRect me, newSpriteRect, flashSubRect, trimLeft, trimTop
  138.   global gShowArbusRects
  139.   show(me)
  140.   if gShowArbusRects then
  141.     put "Arbus Rect" && newSpriteRect
  142.   end if
  143.   pSpr.rect = newSpriteRect
  144.   centerPt = point(newSpriteRect.width / 2.0, newSpriteRect.height / 2.0)
  145.   pSpr.viewH = flashSubRect.left + centerPt[1] + trimLeft
  146.   pSpr.viewV = flashSubRect.top + centerPt[2] + trimTop
  147. end
  148.  
  149. on showTree Msg
  150. end
  151.  
  152. on soundPlaying me
  153.   return soundBusy(pSoundChannel)
  154. end
  155.  
  156. on setAnimationPlane me, plane
  157.   pSpr.locZ = plane
  158. end
  159.  
  160. on stopSound me
  161.   sound stop pSoundChannel
  162. end
  163.  
  164. on hide me
  165.   pSpr.imageEnabled = 0
  166.   pSpr.rect = rect(0, 0, 1, 1)
  167. end
  168.  
  169. on show me
  170.   wasEnabled = pSpr.imageEnabled
  171.   pSpr.imageEnabled = 1
  172. end
  173.  
  174. on characterLeft me
  175.   global gGameTips
  176.   stopAnimating(me)
  177.   hide(me)
  178.   removeCharacterTraces(me)
  179. end
  180.  
  181. on stopAnimating me
  182.   stopSound(me)
  183. end
  184.